import VueRouter from 'vue-router'
import Vue from 'vue'
import ToLogin from "@/components/ToLogin";
import Index from "@/components/Index";
import IndexPage from "@/components/pages/IndexPage";
import UserPage from "@/components/pages/UserPage";
import RolePage from "@/components/pages/RolePage";
import FenceMapPage from "@/components/pages/FenceMapPage";
import ElectronicPage from "@/components/pages/ElectronicPage";
import DeptPage from "@/components/pages/DeptPage";

import OperLogPage from "@/components/pages/OperLogPage";
import PlaybackPage from "@/components/pages/PlaybackPage";
import MenuPage from "@/components/pages/MenuPage";
import ScheduleTaskPage from "@/components/pages/ScheduleTaskPage";
import ScheduleLogPage from "@/components/pages/ScheduleLogPage";
import ForewarningPage from "@/components/pages/ForewarningPage";
import LoginInforPage from "@/components/pages/LoginInforPage";
import AddMenu from "@/components/pages/AddMenu";
import CityPage from "@/components/pages/CityPage";

Vue.use(VueRouter)

const router = new VueRouter({
        routes: [
            {path: "/", redirect: "/login"},
            {
                path: "/index", component: Index,
                //二级路由
                children: [
                    {path: "/", redirect: "index"},
                    {path: "index", component: IndexPage},
                    //第一组
                    {path: "user", component: UserPage},
                    {path: "role", component: RolePage},
                    {path: "dept", component: DeptPage},
                    {path: "city", component: CityPage},

                    {path: "fence", component: FenceMapPage},
                    {path: "electronic", component: ElectronicPage},
                    {path: "menu", component: MenuPage},
                    {path: "addMenu", component: AddMenu},
                    {path: "operLogPage", component: OperLogPage},
                    {path: "playbackPage", component: PlaybackPage},
                    {path: "scheduleTask", component: ScheduleTaskPage},
                    {path: "scheduleLog", component: ScheduleLogPage},
                    //第四组页面，勿删
                    {path: "operLog", component: OperLogPage},
                    {path: "playback", component: PlaybackPage},
                    {path: "forewarning", component: ForewarningPage},
                    {path: "loginInfor", component: LoginInforPage},
                    //四组结束
                ]
            },
            {path: "/login", component: ToLogin},
        ]
    }
)

export default router;
